package com.yuexunit.operationman.nbsy.module.BeforeAnesthesiaVisit.ui.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;


import com.yuexunit.operationman.nbsy.R;
import com.yuexunit.operationman.nbsy.config.AppConfig;
import com.yuexunit.operationman.nbsy.module.BeforeAnesthesiaVisit.bean.BeforeAnesthesiaBean;
import com.yuexunit.operationman.nbsy.module.BeforeAnesthesiaVisit.ui.Act_BeforeAnesthesiaPreview;

import org.kymjs.kjframe.ui.KJFragment;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by chenss on 2017/8/8 0008.
 */

public class Fragment_BA_Number extends KJFragment {

    @Bind(R.id.frag_ba_num_01)
    TextView fragBaNum01;
    @Bind(R.id.frag_ba_num_02)
    TextView fragBaNum02;
    @Bind(R.id.frag_ba_num_03)
    TextView fragBaNum03;
    @Bind(R.id.frag_ba_num_04)
    TextView fragBaNum04;
    @Bind(R.id.frag_ba_num_05)
    TextView fragBaNum05;
    @Bind(R.id.frag_ba_num_06)
    TextView fragBaNum06;
    @Bind(R.id.frag_ba_num_07)
    TextView fragBaNum07;
    @Bind(R.id.frag_ba_num_08)
    TextView fragBaNum08;
    @Bind(R.id.frag_ba_num_09)
    TextView fragBaNum09;
    @Bind(R.id.frag_ba_num_10)
    TextView fragBaNum10;
    @Bind(R.id.frag_ba_num_11)
    TextView fragBaNum11;
    @Bind(R.id.frag_ba_num_12)
    TextView fragBaNum12;
    @Bind(R.id.frag_ba_num_13)
    TextView fragBaNum13;

    private Act_BeforeAnesthesiaPreview aty;
    protected View mMainView;

    @Override
    protected View inflaterView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
        aty = (Act_BeforeAnesthesiaPreview) getActivity();
        mMainView = inflater.inflate(R.layout.fragment_ba_number, container, false);
        ButterKnife.bind(this, mMainView);
        return mMainView;
    }

    @Override
    protected void initData() {
        for(BeforeAnesthesiaBean.ObjectEntity.VisitItemsEntity p : AppConfig.BEFOREANSETHESIA.getObject().getVisitItems()) {
            switch (p.getItemCode()) {
                case "Hb/HCT":
                    if(p.getItemValue().length()>0)
                    {
                        fragBaNum01.setText(p.getItemValue());
                    }
                    break;
                case "WBC":
                    if(p.getItemValue().length()>0)
                    {
                        fragBaNum02.setText(p.getItemValue());
                    }
                    break;
                case "PLT":
                    if(p.getItemValue().length()>0)
                    {
                        fragBaNum03.setText(p.getItemValue());
                    }
                    break;
                case "K":
                    if(p.getItemValue().length()>0)
                    {
                        fragBaNum04.setText(p.getItemValue());
                    }
                    break;
                case "Na":
                    if(p.getItemValue().length()>0)
                    {
                        fragBaNum05.setText(p.getItemValue());
                    }
                    break;
                case "Cl":
                    if(p.getItemValue().length()>0)
                    {
                        fragBaNum06.setText(p.getItemValue());
                    }
                    break;
                case "GLU":
                    if(p.getItemValue().length()>0)
                    {
                        fragBaNum07.setText(p.getItemValue());
                    }
                    break;
                case "SGPT":
                    if(p.getItemValue().length()>0)
                    {
                        fragBaNum08.setText(p.getItemValue());
                    }
                    break;
                case "BUN":
                    if(p.getItemValue().length()>0)
                    {
                        fragBaNum09.setText(p.getItemValue());
                    }
                    break;
                case "Cr":
                    if(p.getItemValue().length()>0)
                    {
                        fragBaNum10.setText(p.getItemValue());
                    }
                    break;
                case "PT":
                    if(p.getItemValue().length()>0)
                    {
                        fragBaNum11.setText(p.getItemValue());
                    }
                    break;
                case "APTT":
                    if(p.getItemValue().length()>0)
                    {
                        fragBaNum12.setText(p.getItemValue());
                    }
                    break;
                case "PaO2":
                    if(p.getItemValue().length()>0)
                    {
                        fragBaNum13.setText(p.getItemValue());
                    }
                    break;
            }
        }
    }
}
